package com.fc.happyteam.admin;

import com.fc.happyteam.common.ResponseJson;
import com.fc.happyteam.entity.SysUserEntity;
import com.fc.happyteam.service.ISysUserService;
import com.fc.happyteam.utils.R;
import com.fc.happyteam.utils.ShiroUtils;
import org.apache.shiro.crypto.hash.Sha256Hash;
import org.aspectj.apache.bcel.classfile.Code;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.IOException;

/**
 * 登录相关
 *
 * @author Rocky
 */
@Controller
public class SysLoginController {

    @Autowired
    private ISysUserService sysUserService;

    /**
     * 登录
     */
    @ResponseBody
    @RequestMapping(value = "/login", method = RequestMethod.POST)
    public R login() throws IOException {
       return R.error(401,"您已经登录，请不要重复登录");
    }

    /**
     * 退出
     */
    @RequestMapping(value = "logout", method = RequestMethod.GET)
    public String logout() {
        ShiroUtils.logout();
        return "redirect:login.html";
    }

}